// ml:run = $bin < input
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
int n1, n2, n3;
int y[1050];
int x[1050];
int point[1050][1050];
int inter[1050][1050];
int main()
{

	std::ios_base::sync_with_stdio(false);
	while(~scanf("%d%d%d", &n1, &n2, &n3)){
		for(int i=1;i<=n1;i++)
			scanf("%d", &y[i]);
		for(int i=1;i<=n2;i++)
			scanf("%d", &x[i]);
		memset(point , 0, sizeof(point));
		memset(inter , 0, sizeof(inter));
		int x1, y1;
		for(int i=1;i<=n3;i++)
		{
			scanf("%d%d", &x1, &y1);
			point[x1+1][y1+1]=1;
		}
		for(int i=0;i<=1001;i++)
			for(int j=1;j<=1001;j++)point[i][j]+=point[i][j-1];
		for(int j=0;j<=1001;j++)
			for(int i=1;i<=1001;i++)point[i][j]+=point[i-1][j];
		for(int i=1;i<=n1;i++)
			for(int j=1;j<=n2;j++)
			{
				x1=x[j]+1;
				y1=y[i]+1;
				inter[x1][y1]++;
			}
		for(int i=1001;i>=0;i--)
			for(int j=1001;j>=0;j--)
				inter[i][j]+=inter[i+1][j+1];
		long long ans=0;
		for(int i=1;i<=n1;i++)
			for(int j=1;j<=n2;j++)
			{
				x1=x[j]+1;
				y1=y[i]+1;
				if(point[1001][1001]-point[1001][y1-1]-point[x1-1][1001]+point[x1-1][y1-1]==0)
					continue;
				int left=1;
				int right=std::min(1001-x1, 1001-y1);
				if(right<left)continue;
				int tag=-1;
				while(left<=right)
				{
					if(left==right){tag=left;break;}
					int mid=(left+right)>>1;
					if(point[mid+x1][mid+y1]-point[mid+x1][y1-1]-point[x1-1][mid+y1]+point[x1-1][y1-1]==0)
						left=mid+1;
					else right=mid;
				}
				ans+=inter[tag+x1][tag+y1];
			}
		printf("%lld\n", ans);}
}

